﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using Service.BusinessLayer.Entities;
using Service.BusinessLayer.Logic;
using Service.DataAccess.DataAccessHelper;
namespace Service
{
    /// <summary>
    /// Summary description for WS_KhachHang
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class WS_KhachHang : System.Web.Services.WebService
    {
        XL_KhachHang xlkh = new XL_KhachHang();
        [WebMethod]
        public string layds()
        {
            string kq = "";
            kq = xlkh.layds().GetXml();
            return kq;
        }
        [WebMethod]
        public void them(string hokh, string tenkh,bool gioitinh,string diachi,string sdt,string tentaikhoan,string matkhau)
        {
            KhachHang kh = new KhachHang(hokh,tenkh,gioitinh,diachi,sdt,tentaikhoan,matkhau);
            xlkh.them(kh);
        }
        [WebMethod]
        public void sua(string hokh, string tenkh, bool gioitinh, string diachi, string sdt, string tentaikhoan, string matkhau)
        {
            KhachHang kh = new KhachHang();
            xlkh.sua(kh);
        }
        [WebMethod]
        public void xoa(int makh)
        {
            xlkh.xoa(makh);
        }
        [WebMethod]
        public string selectquery(string sql)
        {
            string kq = "";
            Helper help = new Helper();
            kq = help.SelectQueryByText(sql).GetXml();
            return kq;
        }
        [WebMethod]
        public string LayDS_Theo_Theo_Ma_TenKH(string ThongTin)
        {
            string kq = "";
            kq = xlkh.LayDS_Theo_TimKiem(ThongTin).GetXml();
            return kq;
        }
        [WebMethod]
        public string LayDS_CTNhapXuat_Theo_MaKH(int MaKH)
        {
            string kq = "";
            kq = xlkh.LayDS_CTNhapXuat_Theo_MaKH(MaKH).GetXml();
            return kq;
        }
        [WebMethod]
        public string LayDS_TKKH_ChucNangTenMH_TenWash(string tenmh, string tenwash)
        {
            string kq = "";
            kq = xlkh.LayDS_TKKH_ChucNangTenhang_Loaiwash(tenmh, tenwash).GetXml();
            return kq;
        }
        [WebMethod]
        public string LayDS_TKKH_ChucNangTenMH(string tenmh)
        {
            string kq = "";
            kq = xlkh.LayDS_TKKH_ChucNangTenhang(tenmh).GetXml();
            return kq;
        }
        [WebMethod]
        public string LayDS_TKKH_ChucNangTenWash(string tenwash)
        {
            string kq = "";
            kq = xlkh.LayDS_TKKH_ChucNangLoaiwash(tenwash).GetXml();
            return kq;
        }
    }
}
